package com.base.util.javautils.observer;

/**
 * Created by gj on 16-1-24.
 * {@code Observer} is the interface to be implemented by objects that
 * receive notification of updates on an {@code IObservableController} object.
 *
 * @see IObservable
 */
public interface IObserver<T extends AbstractObserverMessage> {

    /**
     * This method is called if the specified {@code Observable} object's
     * {@code notifyObservers} method is called (because the {@code Observable}
     * object has been updated.
     *
     * @param controller the {@link IObservableController} object.
     * @param data       the data passed to {@link IObservable#notifyObservers(AbstractObserverMessage)}.
     */
    void update(IObservableController controller, T data);
}